<%@ include file="/WEB-INF/pages/common/taglibs.jsp"%>
<%@ include file="/WEB-INF/pages/common/checkpermission.jsp" %>
<html>
<head>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
    <link href="<c:url value='/styles/cl.css'/>" rel="stylesheet" type="text/css"/>
    <link href="<c:url value='/styles/site1.css'/>" rel="stylesheet" type="text/css"/>    
    <script type="text/javascript" src="<c:url value='/scripts/cl.js'/>"></script>    

<script type="text/javascript">
    function saveRecord() {
         var currentForm = document.forms["insertForm"];
        if(!checkEnd(currentForm.elements["f_file1"].value.toUpperCase(),".PDF")){
            alert('<s:text name="label.upload.format.error"/>');
            return;
        }
        submitForm("insertForm", "addPdfDetail.action");
    }

    function cancelRecord() {
        window.close();
    }

    function fclick(obj, objButton) {
       with (obj) {
           scrollTop = event.y - offsetHeight / 2
           style.posLeft = event.x - offsetWidth / 2
       }
   }

</script>
</head>
<body>
<s:form name="insertForm" action=""  method="post" enctype="multipart/form-data">
   <s:hidden name="erecordModel.selectPageNum"/>
        <table border="0" align="center" cellpadding="0" cellspacing="0" class="body_content full_width bordered">
            <tr class="even">
                <td class="form_label_padded" width="100%" colspan="3">
                     <s:text name="label.new.erecord" />
                </td>
            </tr>
            <tr class="odd">
                <td class="form_label_padded" width="16%" nowrap><s:text name="label.attach.erecord" /></td>
                <td class="form_label_padded" width="2%">:</td>
                <td class="txtData" align="left">
                    <input id="f_file1">&nbsp;<input type="button" onmouseover="fclick(t_file1,this)"
                                                                value="<s:text name='label.browse'/>" class="button">
                    <s:file name="erecordModel.insert" contentEditable="false" style="position:absolute;filter:alpha(opacity=0);width:30px;" id="t_file1"
                                       onchange="f_file1.value=this.value" />
                </td>
            </tr>
            <tr class="even">
                <td class="txtData" colspan="3">
                     <input type="button" class="button" value="<s:text name='label.save'/>" onclick="saveRecord();">
                     <input type="button" class="button" value="<s:text name='label.back'/>" onclick="cancelRecord();">
                </td>
            </tr>               
    </table>
</s:form>
</body>
</html>